Skip to content

Added launch.json for local debugging with VSCode #376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Bobbins228
Copy link
Contributor

@Bobbins228 Bobbins228 commented Oct 24, 2023

Issue link

What changes have been made

Added launch.json file for local debugging of the CodeFlare Operator

Verification steps

Fill in the launch.json file with your kube config file path and namespace the CFO should be acting in.
Scale down the CodeFlare Operator deployment if it exists in your cluster.
The operator should be running locally with VSCode.

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • Testing is not required for this change

Copy link
Member

@tedhtchang tedhtchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Bobbins228 Could you add an example on how you run local debugger with the launch.json in the https://github.com/project-codeflare/codeflare-operator/blob/main/CONTRIBUTING.md

@Bobbins228 Bobbins228 requested a review from tedhtchang October 25, 2023 10:45
Copy link
Contributor

@Fiona-Waters Fiona-Waters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just aded a few comments.
Checked out this PR and was able to run CFO locally via debugger in VSCode.

Copy link
Contributor

@Fiona-Waters Fiona-Waters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@Fiona-Waters
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Nov 7, 2023
Copy link
Collaborator

@KPostOffice KPostOffice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to get a debugging session running with the given instructions. Thanks @Bobbins228

Copy link

openshift-ci bot commented Nov 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: KPostOffice

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Nov 7, 2023
@openshift-merge-bot openshift-merge-bot bot merged commit b0f15b8 into project-codeflare:main Nov 7, 2023
@ronensc
Copy link
Contributor

ronensc commented Nov 8, 2023

@Bobbins228 Thanks!
After I set .vscode/launch.json with my custom values, every time I run git status it appears as a modified file.
I was able to make git ignore it by:

git update-index --skip-worktree .vscode/launch.json

The reverse command is:

git update-index --no-skip-worktree .vscode/launch.json

ref: https://stackoverflow.com/a/50222853

Did you find a better solution to make git ignore this custom changes?

@Bobbins228
Copy link
Contributor Author

@ronensc That's odd I see what you mean. I included the .vscode folder in the .gitignore file so by all means it should be ignored when changes are added to launch.json

@ronensc
Copy link
Contributor

ronensc commented Nov 8, 2023

AFAIK, once git tracks a file, you can't ignore it with .gitignore.
An alternative approach would be to save the template file as launch.json.example and track it with git. Then, each developer can make a copy of it locally (launch.json) that will be added to .gitignore. Although, I'm not sure this approach is better.

@Bobbins228
Copy link
Contributor Author

I see I'll look into a way of handling this and if there isn't any other solution we'll go with an example file. Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants